package com.itheima.HomeWork;

public class Student {
    private String Name;
    private String Sex;
    private Integer Age;

    public Student() {
    }

    public Student(String name, String sex, Integer age) {
        Name = name;
        Sex = sex;
        Age = age;
    }

    public String getName() {
        return Name;
    }

    public void setName(String name) {
        Name = name;
    }

    public String getSex() {
        return Sex;
    }

    public void setSex(String sex) {
        if (Sex.equals("男")&&Sex.equals("女")){
            Sex = sex;
        }else {
            throw new RuntimeException("性别异常");
        }

    }

    public Integer getAge() {
        return Age;
    }

    public void setAge(Integer age) {
        if (Age>=15&&Age<=50){
            Age = age;
        }else {
            throw new RuntimeException("年龄异常");
        }

    }
}
